package com.timzer.ganymed;

import ch.ethz.ssh2.Connection;

public class SSH2Demo {

    public static void main(String[] args) {
        try {
            String host = "47.100.20.140";
            String username = "root";
            String password = "#EDCvgy7&UJM2021";
//            String host = "127.0.0.1";
//            String username = "timzer";
            Connection connection = SSH2Util.openConnection(host,username,password);
            String cpuInfo = "df -h"; //服务器核数
            ExecCmdResult cup = SSH2Util.execCommand(connection,cpuInfo);
            connection.close();

        }
        catch (Exception a){
            a.printStackTrace();
        }
    }
}

